#!/bin/bash

set -e

function apt_get_install() {
    if [ -z ${TOOLS_LIST} ]; then
        echo -e "Please set list file dir"
        return 0
    fi
    dos2unix ${TOOLS_LIST}
    while read install_cmd; do
        local cnt=$(echo "${install_cmd}" | grep apt | wc -l)
        if [[ ${cnt} -gt 0 ]]; then
            echo -e "${install_cmd}"
            bash -c "${install_cmd}"
        fi
    done < ${TOOLS_LIST}
}

apt_get_install
